import JSEncrypt from 'jsencrypt'

const publicKey =
  'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDF8tnVzptBVMxSzkvY5M65e8HOp8Zqa78m8W5UUYMHcaMUVM9zN1a5GY/dN83r2lpNxUkTSgiB6uXzk5e1I0By0bub4ZKmJhX9zE5L5V0V4WORT80yNaCZW4dvETnAgzH2IZEgGYMBcX060kMX6FzB6TCPr+eBhhQpuSd2+HpatQIDAQAB'

/**
 * @method encryption()  加密
 *
 *
 * * publicKey:公钥；password:密码
 */
export const encryption = (password) => {
  let encryptor = new JSEncrypt()

  encryptor.setPublicKey(publicKey)

  let pwd = encryptor.encrypt(password)

  return pwd
}
